home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / Asap / ASAP / AslRequest.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-19  |  3.0 KB  |  74 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AAslRequest wrapper class                                                 *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_AAslRequest_H
  12. #define ASAP_AAslRequest_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/Asl.h>
  19. }
  20.  
  21. // template <int reqType>
  22. class AAslRequest
  23. {
  24.  public:
  25.  inline static AAslRequest * AllocAslRequest(unsigned long reqType, TagItem * tagList);
  26.  inline void * operator new(size_t, unsigned long reqType, TagItem * tagList);
  27.  inline static AAslRequest * AllocAslRequestTags(unsigned long reqType, Tag Tag1,  ...);
  28.  inline void * operator new(size_t, unsigned long reqType, Tag Tag1,  ...);
  29.  inline BOOL AslRequest(TagItem * tagList);
  30.  inline BOOL AslRequestTags(Tag Tag1,  ...);
  31.  inline void FreeAslRequest();
  32.  inline void operator delete(void *requester);
  33. };
  34. //----------------------------------------------------------------------------
  35. AAslRequest * AAslRequest::AllocAslRequest (unsigned long reqType, TagItem * tagList)
  36. {
  37.  return (AAslRequest *) ::AllocAslRequest(reqType, tagList);
  38. }
  39. //----------------------------------------------------------------------------
  40. void * operator new(size_t, unsigned long reqType, TagItem * tagList);
  41. {
  42.  return AAslRequest::AllocAslRequest(reqType, tagList);
  43. }
  44. //----------------------------------------------------------------------------
  45. AAslRequest * AAslRequest::AllocAslRequestTags (unsigned long reqType, Tag Tag1,  ...)
  46. {
  47.  return AAslRequest::AllocAslRequest(reqType, (TagItem *) &Tag1);
  48. }
  49. //----------------------------------------------------------------------------
  50. void * AAslRequest::operator new (size_t, unsigned long reqType, Tag Tag1,  ...)
  51. {
  52.  return AAslRequest::AllocAslRequest(reqType, (TagItem *) &Tag1);
  53. }
  54. //----------------------------------------------------------------------------
  55. BOOL AAslRequest::AslRequest (TagItem * tagList)
  56. {
  57.  return ::AslRequest(this, tagList);
  58. }
  59. //----------------------------------------------------------------------------
  60. BOOL AAslRequest::AslRequestTags (Tag Tag1,  ...)
  61. {
  62.  return AAslRequest::AslRequest(this, (TagItem *) &Tag1);
  63. }
  64. //----------------------------------------------------------------------------
  65. void AAslRequest::FreeAslRequest (APTR requester)
  66. {
  67.  ::FreeAslRequest(requester);
  68. }
  69. //----------------------------------------------------------------------------
  70. void AAslRequest::operator delete(void *requester)
  71. {
  72.  ((AAslRequest *) requester)->FreeAslRequest(requester);
  73. }
  74.